package com.henghe.frame.common.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import springfox.documentation.annotations.ApiIgnore;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Description:父级实体类
 * Author: LiuWenQing
 * Datetime: 2023/3/17 14:28
 */
@Data
@ApiModel
@ApiIgnore
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    @ExcelIgnore
    private Timestamp ctDate;

    @TableField(fill = FieldFill.INSERT)
    @ExcelIgnore
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    private Long ctUserId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelIgnore
    private Timestamp ltDate;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelIgnore
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    private Long ltUserId;
}
